﻿using WikiMaml.Renderers;
using Xunit;
using Xunit.Extensions;

namespace WikiMaml.Facts.Renderers
{
    public class AlertRendererFacts
    {
        public class CanExpand
        {
            [Theory]
            [InlineData(MamlScopeName.AlertBegin)]
            [InlineData(MamlScopeName.AlertEnd)]
            public void Should_be_able_to_expand_scope_name(string scopeName)
            {
                var renderer = new AlertRenderer();

                bool result = renderer.CanExpand(scopeName);

                Assert.True(result);
            }
        }

        public class Expand
        {
            [Fact]
            public void Should_expand_begin_scope_correctly()
            {
                var renderer = new AlertRenderer();

                string result = renderer.Expand(MamlScopeName.AlertBegin, "note", x => x, x => x);

                Assert.Equal("<alert class=\"note\">", result);
            }

            [Fact]
            public void Should_expand_end_scope_correctly()
            {
                var renderer = new AlertRenderer();

                string result = renderer.Expand(MamlScopeName.AlertEnd, "{alert}", x => x, x => x);

                Assert.Equal("</alert>", result);
            }
        }
    }
}
